/*
 * ECameraLogic.h
 *
 *  Created on: 15-06-2013
 *      Author: Jarek
 */

#ifndef CAMERALOGIC_H_
#define CAMERALOGIC_H_

#include "GlobalData.h"
#include "ETime.h"
#include "Math/EMatrix4x4.h"
#include "View.h"

class CameraLogic : public View {
public:
	Matrix4x4<float>	projectionMatrix;
	Matrix4x4<float>	viewMatrix;

public:
	CameraLogic();
	virtual ~CameraLogic();



	void 		setProjectionMatrix(const Matrix4x4<float>& projectionMatrix);
	void 		setProjectionMatrix(float aspectRatio, float fov, float zNear, float zFar);
	void 		setProjectionMatrix(float left, float right, float bottom, float top, float zNear, float zFar);
	void 		setOrtho			(float left, float right, float bottom, float top, float zNear = -1.0f, float zFar = 1.0f);

	void 		setViewMatrix(const Matrix4x4<float>& viewMatrix);
	void 		setPosAngles(Vector3<float> pos, float horizontalAngle, float verticalAngle, float distance);
	void		setSpherical(Vector3<float> at, float horizontalAngle, float verticalAngle, float distance);
	void		lookAtDir(Vector3<float> pos, Vector3<float> dir, Vector3<float> up);
	void		lookAtPos(Vector3<float> pos, Vector3<float> at, Vector3<float> up = Vector3<float>(0.0f, 1.0f, 0.0f));


	void		zoom(float distance);
	void		move(const Vector3<float>& vector);
	void		rotate(const Vector3<float>& angles);

	virtual Matrix4x4<float> getModelViewMatrix (const ETime& time, const Matrix4x4<float>& modelMatrix);
	virtual Matrix4x4<float> getModelViewProjectionMatrix(const ETime& time, const Matrix4x4<float>& modelMatrix);
};

#endif /* CAMERALOGIC_H_ */
